package test;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.UUID;
import java.util.regex.Pattern;

public class Main1 {

	public static void main(String[] args) throws ParseException {
		ArrayList<String> as = new ArrayList<String>(2);
//		as.add("ddddddd");
		as.add(0, "eee");
		if (true) {
			SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd", Locale.US);
			Date date = simpleDateFormat.parse("200201029");
			Calendar calender = Calendar.getInstance();
			calender.setTime(date);
			calender.add(Calendar.MONTH, -1);
			System.out.println(simpleDateFormat.format(calender.getTime()));
		}
		if (true) {
			String id = UUID.randomUUID().toString().replaceAll("-", "");
			System.out.println(id);
		}
		String str = "http://www.aiform.net/hello.jpg";
		String escUrl = "(.*)((\\.html)|(\\.js)|(\\.css)|(\\.gif)|(\\.png)|(\\.jpg)|(\\.swf)|(\\.zip)|(\\.rar)|(\\.doc)|(\\.xls)|(\\.txt)|(\\.pdf))";
		if (Pattern.matches(escUrl, str)) {
			System.out.println("ok");
		}
	}

}
